package com.summer.content.feignClient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
@Component
public class MediaClientFallbackFactory implements FallbackFactory<MediaClient> {
    @Override
    public MediaClient create(Throwable throwable) {
        return (file, objectName) -> {
            // 降级处理逻辑
            log.error("降级方法触发，异常信息: {}", throwable.toString());
            log.error("MultipartFile={}, objectName={}", file, objectName);
            return null;
        };
    }
}
